import { ComponentInfo } from '@/components/editor';

type Data = {
  id: number;
  title: string;
  desc?: string;
  js?: string;
  css?: string;
  componentList: ComponentInfo[];
};

const input1: ComponentInfo = {
  fe_id: '1',
  isHidden: false,
  type: 'input',
  title: 'input',
  props: {
    title: '姓名',
    placeholder: '请输入姓...',
  },
};
const input2: ComponentInfo = {
  fe_id: '2',
  isHidden: false,
  type: 'input',
  title: 'input',
  props: {
    title: '电话',
    placeholder: '请输入电话...',
  },
};

const title: ComponentInfo = {
  fe_id: '3',
  isHidden: false,
  type: 'title',
  title: 'title',
  props: {
    text: '一行标题',
    level: 1,
    isCenter: false,
  },
};

const paragraph: ComponentInfo = {
  fe_id: '4',
  isHidden: false,
  type: 'paragraph',
  title: '段落aaaa',
  props: {
    text: '一行段落...',
    isCenter: false,
  },
};

const info: ComponentInfo = {
  fe_id: '5',
  isHidden: false,
  type: 'info',
  title: '信息',
  props: {
    title: '信息标题',
    description: '信息描述......',
  },
};

const textArea: ComponentInfo = {
  fe_id: '6',
  isHidden: false,
  type: 'textarea',
  title: '多行输入',
  props: {
    title: '多行输入框',
    placeholder: '请输入...',
  },
};

const options = [
  { label: '选项1', value: '1' },
  { label: '选项2', value: '2' },
  { label: '选项3', value: '3' },
];

const radio: ComponentInfo = {
  fe_id: '7',
  isHidden: false,
  type: 'radio',
  title: '单选框',
  props: {
    title: '单选框',
    isVertical: false,
    value: options[0].value,
    options,
  },
};

const list = [
  { text: '选项1', value: '1', checked: false },
  { text: '选项2', value: '2', checked: false },
  { text: '选项3', value: '3', checked: false },
];

const checkBox: ComponentInfo = {
  fe_id: '8',
  isHidden: false,
  type: 'checkbox',
  title: '多选框',
  props: {
    title: '多选框',
    isVertical: false,
    list,
  },
};

export const data: Data = {
  id: 123,
  title: '和又发了',
  desc: '问卷描述',
  js: '',
  css: '',
  componentList: [
    checkBox,
    radio,
    input1,
    input2,
    title,
    paragraph,
    info,
    textArea,
  ],
};
